package com.model;

// Generated 15 f�vr. 2013 15:56:26 by Hibernate Tools 4.0.0

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * ElementContrat generated by hbm2java
 */
@Entity
@Table(name = "ElementContrat", schema = "dbo", catalog = "CRM")
public class ElementContrat implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int elementContratId;
	private ElementContratType elementContratType;
	private String libelle;
	private BigDecimal montant;
	private Set<TermeDeService> termeDeServices = new HashSet<TermeDeService>(0);
	private Set<Enquete> enquetes = new HashSet<Enquete>(0);
	private Set<Anomalie> anomalies = new HashSet<Anomalie>(0);

	public ElementContrat() {
	}

	public ElementContrat(int elementContratId) {
		this.elementContratId = elementContratId;
	}

	public ElementContrat(int elementContratId,
			ElementContratType elementContratType, String libelle,
			BigDecimal montant, Set<TermeDeService> termeDeServices, Set<Enquete> enquetes, Set<Anomalie> anomalies) {
		this.elementContratId = elementContratId;
		this.elementContratType = elementContratType;
		this.libelle = libelle;
		this.montant = montant;
		this.termeDeServices = termeDeServices;
		this.enquetes = enquetes;
		this.anomalies = anomalies;
	}

	@Id
	@GeneratedValue
	@Column(name = "ElementContratId", unique = true, nullable = false)
	public int getElementContratId() {
		return this.elementContratId;
	}

	public void setElementContratId(int elementContratId) {
		this.elementContratId = elementContratId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "elementContratTypeId")
	public ElementContratType getElementContratType() {
		return this.elementContratType;
	}

	public void setElementContratType(ElementContratType elementContratType) {
		this.elementContratType = elementContratType;
	}

	@Column(name = "libelle", length = 100)
	public String getLibelle() {
		return this.libelle;
	}

	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}

	@Column(name = "montant", precision = 10)
	public BigDecimal getMontant() {
		return this.montant;
	}

	public void setMontant(BigDecimal montant) {
		this.montant = montant;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "elementContrat")
	public Set<TermeDeService> getTermeDeServices() {
		return this.termeDeServices;
	}

	public void setTermeDeServices(Set<TermeDeService> termeDeServices) {
		this.termeDeServices = termeDeServices;
	}

	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "elementContrats")
	public Set<Enquete> getEnquetes() {
		return this.enquetes;
	}

	public void setEnquetes(Set<Enquete> enquetes) {
		this.enquetes = enquetes;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "elementContrat")
	public Set<Anomalie> getAnomalies() {
		return this.anomalies;
	}

	public void setAnomalies(Set<Anomalie> anomalies) {
		this.anomalies = anomalies;
	}

}
